package com.newtouch.service.impl;

import java.util.List;
import com.newtouch.common.Page;
import com.newtouch.model.Company;
import com.newtouch.service.CompanyService;
import com.newtouch.dao.CompanyDao;
import com.newtouch.service.base.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CompanyServiceImpl extends BaseServiceImpl implements
		CompanyService {
	@Autowired
	private CompanyDao companydao;

	public CompanyDao getCompanydao() {
		return companydao;
	}

	public void setCompanydao(CompanyDao companydao) {
		this.companydao = companydao;
	}

	public void addCompany(Company company) {
		companydao.insertModelObject(company);
	}

	public Integer deleteCompany(String id) {
		return companydao.deleteModelObject(new Long(id));
	}

	public Integer editCompany(Company company) {
		return companydao.updateModelObject(company);
	}

	public Company findCompanyById(String id) {
		return companydao.getModelObject(new Long(id));
	}

	public List<Company> findCompanys(Page page) {
		return companydao.selectModelObjectListPage(page);
	}
}